#include <iostream>
using namespace std;
int m,n,k;
int a[1005],b[1005];
int main(){
	cin>>m>>n>>k;
	for(int i=0;i<m;++i)a[i]=i+1;
	for(int i=0;i<n;++i)b[i]=i+1;
	for(int i=0;i<k;++i)
		cout<<a[i%m]<<' '<<b[i%n]<<endl;
	return 0; 
}
